package com.mytijian.runtime.executor;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.mytijian.runtime.model.param.AliCommonParam;

@Component("serviceExecutor")
public class DefaultServiceExecutor implements ServiceExecutor{

	@Autowired
	private ServiceWorkerFactory serviceWorkerFactory;

	@Override
	public <T extends AliCommonParam> Object execute(T param, String data) {
		ServiceWorker serviceWorkor = serviceWorkerFactory.createService(param.getMethod());
		return serviceWorkor.execute(param, data);
	}

}
